home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0052_TDBGrid Derivative exposes Col.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-11-24  |  890 b   |  42 lines

  1.  
  2. {Here's a TDBGrid derivative that exposes the Col, Row and Canvas properties
  3. as well as the CellRect method.  This is extremely useful if you would like
  4. to, for example, pop a dropdown list over a cell when the user enters.
  5. }
  6.  
  7. unit VUBComps;
  8.  
  9. interface
  10.  
  11. uses
  12.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  13.   Forms, Dialogs, Grids, DBGrids, DB, Menus;
  14.  
  15. type
  16.   TDBGridVUB = class(TDBGrid)
  17.   private
  18.     { Private declarations }
  19.   protected
  20.     { Protected declarations }
  21.   public
  22.     property Canvas;
  23.     function CellRect(ACol, ARow: Longint): TRect;
  24.     property Col;
  25.     property Row;
  26.  
  27. procedure Register;
  28.  
  29. implementation
  30.  
  31. procedure Register;
  32. begin
  33.   RegisterComponents('VUBudget', [TDBGridVUB]);
  34. end;
  35.  
  36. function TDBGridVUB.CellRect(ACol, ARow: Longint): TRect;
  37. begin
  38.   Result := inherited CellRect(ACol, ARow);
  39. end;
  40.  
  41. end.
  42.